//轮播图
var swiper = new Swiper('.swiper-container', {
    loop: true,
    spaceBetween: 30,
    centeredSlides: true,

    autoplay: {
        delay: 2500,
        disableOnInteraction: false,
    },
    pagination: {
        el: '.swiper-pagination',
        clickable: true,
    },
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },
});

//显示和隐藏
var two1 = document.querySelector("#two1");
var one1 = document.querySelector("#one");
two1.addEventListener("click",function(){
    one1.style.display = "block";

});
two1.addEventListener("mouseout",function(){
    one1.style.display = "none";
});
 one1.addEventListener("mouseover",function(){
    one1.style.display = "block";
});
one1.addEventListener("mouseout",function(){
    one1.style.display = "none";
});


//返回顶部
var to2top = document.querySelector("#to-top");
window.onscroll = function(){
    console.log(document.documentElement.scrollTop || document.body.scrollTop);
}
    to2top.addEventListener('click',function(){
        window.scrollTo({
            top:0,
            behavior:'smooth'
        });
    })


